<html>﻿<!DOCTYPE html>
<html>
<head>
    <style>

        button {
            margin: 10px;
        }

        div {
            color: blue;
            font-weight: bold;
        }

        span {
            color: red;
        }
    </style>

    <script src="../../../../../../../g.tbcdn.cn/kissy/k/1.3.2/seed.js" tppabs="http://g.tbcdn.cn/kissy/k/1.3.2/seed.js" data-config="{combine:true}"></script>
</head>
<body>
<button class='first'>Button #1</button>
<button class='last'>Button #2</button>
<div><span class='first'>0</span> button #1 clicks.</div>

<div><span class='last'>0</span> button #2 clicks.</div>
<script>
    KISSY.use('core', function (S) {
        var $ = KISSY.Node.all;

        $("button.first").on('click', function () {
            update($("span.first"));
        });

        $("button.last").on('click', function () {
            $("button.first").fire('click');
            update($("span.last"));
        });

        function update(j) {
            var n = parseInt(j.text(), 10);
            j.text(n + 1);
        }
    });
</script>

</body>
</html>